const rePhoneNumber = new RegExp('^\\d{11}$');
const reInvitationCode = new RegExp('^.{6}$');
const reValidationCode = new RegExp('^.{6}$');
const rePassword = new RegExp('^.{6}$');

const phoneNumberValidator = phoneNumber => rePhoneNumber.test(phoneNumber);

const invitationCodeValidator = code =>  reInvitationCode.test(code);

const validationCodeValidator = code =>  reValidationCode.test(code);

const passwordValidator = password =>  typeof(password) === 'string' && password.length >= 6;

export default {
    phoneNumber: phoneNumberValidator,
    invitationCode: invitationCodeValidator,
    validationCode: validationCodeValidator,
    password: passwordValidator,
}